From: Alastair Tse Date: Thu, 4 Jan 2007 14:25:58 +0000 (+0000) Subject: Switch hotplug scripts to use /bin/bash rather than /bin/sh. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15422^2~92 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=b2bfd9596fee74d3d3e5f97134c17119aa61a9d4;p=xen.git Switch hotplug scripts to use /bin/bash rather than /bin/sh. Hotplug scripts include certain bash-isms that are not supported under some distros' default shell (eg. Ubuntu 6.10's use of dash) Signed-off-by: Alastair Tse --- diff --git a/tools/examples/blktap b/tools/examples/blktap index bc25b48be2..5a7ee3236b 100644 --- a/tools/examples/blktap +++ b/tools/examples/blktap @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright (c) 2005, XenSource Ltd. diff --git a/tools/examples/block b/tools/examples/block index 8ec73231bf..2b6b991125 100644 --- a/tools/examples/block +++ b/tools/examples/block @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash dir=$(dirname "$0") . "$dir/block-common.sh" diff --git a/tools/examples/block-enbd b/tools/examples/block-enbd index 75c6f257aa..67faa84268 100755 --- a/tools/examples/block-enbd +++ b/tools/examples/block-enbd @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Usage: block-enbd [bind server ctl_port |unbind node] # diff --git a/tools/examples/block-nbd b/tools/examples/block-nbd index 8c5cb17b79..b29b31564a 100644 --- a/tools/examples/block-nbd +++ b/tools/examples/block-nbd @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Usage: block-nbd [bind server ctl_port |unbind node] # diff --git a/tools/examples/external-device-migrate b/tools/examples/external-device-migrate index fa52334231..c7c99afec3 100644 --- a/tools/examples/external-device-migrate +++ b/tools/examples/external-device-migrate @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright (c) 2005 IBM Corporation # diff --git a/tools/examples/network-bridge b/tools/examples/network-bridge index 49b79db95b..b616a72275 100755 --- a/tools/examples/network-bridge +++ b/tools/examples/network-bridge @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #============================================================================ # Default Xen network start/stop script. # Xend calls a network script when it starts. diff --git a/tools/examples/network-nat b/tools/examples/network-nat index 94b84307c0..62d2b0c259 100644 --- a/tools/examples/network-nat +++ b/tools/examples/network-nat @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #============================================================================ # Default Xen network start/stop script when using NAT. # Xend calls a network script when it starts. diff --git a/tools/examples/network-route b/tools/examples/network-route index de535c3280..574441e334 100755 --- a/tools/examples/network-route +++ b/tools/examples/network-route @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #============================================================================ # Default Xen network start/stop script. # Xend calls a network script when it starts. diff --git a/tools/examples/vif-bridge b/tools/examples/vif-bridge index 7008210579..0935ad2fae 100755 --- a/tools/examples/vif-bridge +++ b/tools/examples/vif-bridge @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #============================================================================ # /etc/xen/vif-bridge # diff --git a/tools/examples/vif-common.sh b/tools/examples/vif-common.sh index 50da9a4494..ee67ee2aaa 100644 --- a/tools/examples/vif-common.sh +++ b/tools/examples/vif-common.sh @@ -64,7 +64,7 @@ then fi -function frob_iptable() +frob_iptable() { if [ "$command" == "online" ] then @@ -89,7 +89,7 @@ If you are using iptables, this may affect networking for guest domains." # to those coming from the specified networks, though we allow DHCP requests # as well. # -function handle_iptable() +handle_iptable() { # Check for a working iptables installation. Checking for the iptables # binary is not sufficient, because the user may not have the appropriate @@ -123,7 +123,7 @@ function handle_iptable() # Print the IP address currently in use at the given interface, or nothing if # the interface is not up. # -function ip_of() +ip_of() { ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed -n '1 s,/.*,,p' } @@ -137,7 +137,7 @@ function ip_of() # to these scripts, or eth0 by default. This function will call fatal if no # such interface could be found. # -function dom0_ip() +dom0_ip() { local nd=${netdev:-eth0} local result=$(ip_of "$nd") diff --git a/tools/examples/vif-nat b/tools/examples/vif-nat index 29611654eb..579d7eba35 100644 --- a/tools/examples/vif-nat +++ b/tools/examples/vif-nat @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #============================================================================ # /etc/xen/vif-nat # diff --git a/tools/examples/vif-route b/tools/examples/vif-route index 8d0fb8d76c..f5fd88ed5a 100755 --- a/tools/examples/vif-route +++ b/tools/examples/vif-route @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #============================================================================ # /etc/xen/vif-route # diff --git a/tools/examples/vtpm b/tools/examples/vtpm index cf8b50ff50..38a4532fc2 100644 --- a/tools/examples/vtpm +++ b/tools/examples/vtpm @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash dir=$(dirname "$0") . "$dir/vtpm-hotplug-common.sh" diff --git a/tools/examples/vtpm-delete b/tools/examples/vtpm-delete index 14bfddcd94..b54a093f02 100644 --- a/tools/examples/vtpm-delete +++ b/tools/examples/vtpm-delete @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # This scripts must be called the following way: # vtpm-delete diff --git a/tools/examples/xen-backend.agent b/tools/examples/xen-backend.agent index 3a01a2c7ea..f043854ad0 100755 --- a/tools/examples/xen-backend.agent +++ b/tools/examples/xen-backend.agent @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash PATH=/etc/xen/scripts:$PATH diff --git a/tools/examples/xen-hotplug-cleanup b/tools/examples/xen-hotplug-cleanup index 6356a91892..f7337e45bf 100644 --- a/tools/examples/xen-hotplug-cleanup +++ b/tools/examples/xen-hotplug-cleanup @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash dir=$(dirname "$0") . "$dir/xen-hotplug-common.sh"